﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

using DreamCube.Foundation.Basic.Objects;

namespace Test
{
    class TestThread
    {
        public static void Start()
        {
            ThreadLocker locker = new ThreadLocker();
            Thread thread = new Thread(new ThreadStart(() =>
            {
                locker.EnterWriteLock();
                Thread.Sleep(2000);
                locker.ExitWriteLock();
            }));
            thread.Start();
            ThreadPool.QueueUserWorkItem(new WaitCallback((o) => {
                locker.EnterWriteLock();
            }));
        }
    }
}
